Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Actual behavior
The use of
std::shared_ptr
was unfortunate. I initially had trouble withstd::unique_ptr
:std::initializer_list<std::unique_ptr<T>>
as it always make a copystd::vector<std::unique_ptr<T>>
make use ofstd::initializer_list
Desired behavior
The data should be owned by the modules, and
std::shared_ptr
does not indicate that.Changes
FSM:
std::unique_ptr
instead ofstd::shared_ptr
state_trait
conceptsimple_machine::set_state()
transition now accepts a value that satisfiesstate_trait
, it will be copied in an internalstd::unique_ptr
simple_machine::clear_state()
transitionstack_machine::push_state()
transition now accepts a value that satisfiesstate_trait
, it will be copied in an internalstd::unique_ptr
Behavior Tree:
std::unique_ptr
instead ofstd::shared_ptr
node_trait
conceptmake()
static methodsstd::initializer_list
withstd::vector
node_list()
template function helper to create thestd::vector
using a parameter packUtility AI:
std::unique_ptr
instead ofstd::shared_ptr
action_trait
conceptstd::initializer_list
withstd::vector
action_list()
template function helper to create thestd::vector
using a parameter packGOAP:
std::unique_ptr
instead ofstd::shared_ptr
action_trait
conceptstd::initializer_list
withstd::vector
action_list()
template function helper to create thestd::vector
using a parameter packstd::unique_ptr
(since an action can appear multiple times in a plan)